<template>
  <van-row type="flex" justify="center" align="center">
    <van-col span="4">
      <van-image
        width="3.2rem"
        height="3.2rem"
        radius="1.6rem"
        :src="user.headimgurl"
      />
    </van-col>
    <van-col span="20" >
      <van-cell
        :title="user.name||user.nickname"
      >
      </van-cell>
     
    </van-col>
  </van-row>
</template>

<script>
import { getWeChatUser } from "@/api/wechat";

export default {
  name: "MyPoint",
  props: {
    is_link: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      user: {},
    };
  },
  methods: {
    getWechatUserInfo() {
      const openid = localStorage.getItem("openid");
      getWeChatUser(openid)
        .then((res) => {
          this.user = res.data;
        })
        .catch((error) => {
          console.log(error);
          this.$notify({
            type: "danger",
            message: "获取数据失败！",
          });
        });
    },
  },
  created() {
    this.getWechatUserInfo();
  },
};
</script>

<style  scoped>
.van-image {
  margin: 5px;
  margin-top: 15px;
  padding: 0px;
}
</style>